/* 
 *	Copyright (C) 2009-2010 miaohua
 *	http://code.google.com/p/lrcshower/
 *
 *  This Program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2, or (at your option)
 *  any later version.
 *   
 *  This Program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 *  GNU General Public License for more details.
 *   
 *  You should have received a copy of the GNU General Public License
 *  along with GNU Make; see the file COPYING.  If not, write to
 *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
 *  http://www.gnu.org/copyleft/gpl.html
 *
 */

#pragma once
#include "TypeDef.h"
#include "RenderInterface.h"

// Base class for layed window text render
// Hold common data member and funcions
// And it is a virtual class too, you can't instantiate it
class CLayedWinTextRenderBase: public IRender
{
public:
    // Construnctor & destructor
    CLayedWinTextRenderBase();
    virtual ~CLayedWinTextRenderBase();

    // Change the render's property 
    virtual bool ChangeBgClr(COLORREF Clr);
    virtual bool ChangeBgTransparent(BYTE Transparent);
    virtual bool ChangeFocusLineClr(COLORREF UpperClr, COLORREF MidClr, COLORREF LowerClr);
    virtual bool ChangeUnFocusLineClr(COLORREF UpperClr, COLORREF MidClr, COLORREF LowerClr);
    virtual bool ChangeLrcTransparent(BYTE Transparent);
	virtual bool ChangeFont(const TCHAR * FontName, int FontSize);
	virtual bool ChangeFont(const LOGFONT* font);
    virtual bool ChangeKaraokeMode(bool Mode);
    virtual bool ChangeShadowMode(bool Mode);
	virtual bool ChangeOutlineMode(bool Mode);

protected:
    
    // Render parameters which can be changed by changing-serial functions
    COLORREF m_BgClr;                         // Background color
    COLORREF m_ShadowClr;                     // Shadow color
    COLORREF m_FocusUpperClr;                 // Focus upper part color
    COLORREF m_FocusMidClr;                   // Focus middle part color
    COLORREF m_FocusLowerClr;                 // Focus lower part color
    COLORREF m_UnFocusUpperClr;               // UnFocus upper part color
    COLORREF m_UnFocusMidClr;                 // UnFocus middle part color
    COLORREF m_UnFocusLowerClr;               // UnFocus lower part color
    BYTE m_BgTransparent;                     // Background transparence 
    BYTE m_LrcTransparent;                    // Lrc transparence
    bool m_KaraokeMode;                       // Wether show lrc in karaoke mode
    bool m_ShadowMode;                        // Wether show shadow for lrc
	bool m_OutlineMode;                       // Wether show outline for lrc
    LOGFONT m_LrcFont;                        // Lrc font
	int m_MoveDist;                           // Move distance for lrc( when length of lrc is longer than window's width, the lrc must scrolls horizonally)
	BYTE * m_MemCpyFocus;                     // Hold the painted gdi+ data(focus part)
	BYTE * m_MemCpyUnFocus;                   // Hold the painted gdi+ data(unfocus part)
    SIZE m_LrcBoxSize;                        // Size of Box containing the line of lrc 
	BLENDFUNCTION m_Blend;                    // Blend parameter for layed window functions
};